<?php
require_once "./db_config.php";
$arr=[];
if(isset($_POST['id'])){
    $id=$_POST['id'];
    $ststus=$_POST['status'];
    $sql="SELECT * FROM message WHERE id='$id'and status=$ststus";
    $result=mysqli_query($conn,$sql);
    if(mysqli_num_rows($result) > 0){
        while($row = mysqli_fetch_assoc($result)) {
            $arr[]=$row;
        }
        echo json_encode($arr,JSON_UNESCAPED_UNICODE);
    }else{
        echo "ERROR!";
    }
}
mysqli_close($conn);
